package com.techfengs.chapter04;

public class TernaryOperatorDetail {
  public static void main(String[] args) {
    // 表达式1和表达式2要为可赋给接收变量的类型(或可自动转换)
    int a = 3;
    int b = 8;
    int c = (a>b) ? a : b;
    System.out.println(c);

    c = (a>b) ? (int)1.1 : (int)3.4;
    System.out.println(c);

    double d = (a>b) ? a : (b+3);
    System.out.println(d);
  }
}
